From: Jeroen van der Heijden Date: Mon, 1 Oct 2018 15:29:00 +0000 (+0200) Subject: no posix_fadvice on apple X-Git-Tag: archive/raspbian/2.0.44-1+rpi1~1^2~3^2~8^2~47 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=b026cfdc1e2c766b0c9baadea7ec0a3d0daad361;p=siridb-server.git no posix_fadvice on apple --- diff --git a/src/siri/db/buffer.c b/src/siri/db/buffer.c index 3a484a9b..88d923a6 100644 --- a/src/siri/db/buffer.c +++ b/src/siri/db/buffer.c @@ -136,7 +136,9 @@ int siridb_buffer_open(siridb_t * siridb) return -1; } -#ifndef __APPLE__ +#ifdef __APPLE__ + rc = 0; /* no posix_fadvise on apple */ +#else rc = posix_fadvise(buffer_fd, 0, 0, POSIX_FADV_RANDOM|POSIX_FADV_DONTNEED); if (rc) { @@ -144,7 +146,7 @@ int siridb_buffer_open(siridb_t * siridb) } #endif - return 0; + return rc; } static void buffer__migrate_to_new(char * pt, size_t sz)